home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 21 / CU Amiga Magazine's Super CD-ROM 21 (1998)(EMAP Images)(GB)[!][issue 1998-04].iso / CUCD / Online / elCID / Install_elCID < prev   
Encoding:
Text File  |  1998-02-01  |  37.5 KB  |  1,154 lines

  1. ;###################################################################################################
  2. ;###################################################################################################
  3. ;###
  4. ;###    Multi purpose installer script
  5. ;###    ==============================
  6. ;###
  7. ;###    $VER: elCID_Install 0.6ß (01.02.98)
  8. ;###
  9. ;###    ©1998 by Carsten 'michelangelo' Scholling
  10. ;###
  11. ;###
  12. ;###
  13. ;###    No changed out of strings and main part!
  14. ;###
  15. ;###
  16. ;###################################################################################################
  17. ;###################################################################################################
  18.  
  19.  
  20. ;###################################################################################################
  21. ;###    Debugging stuff
  22. ;###################################################################################################
  23.  
  24.  
  25. ;###################################################################################################
  26. ;###    Error handling stuff
  27. ;###################################################################################################
  28. (onerror (P_Cleanup))
  29.  
  30.  
  31. ;###################################################################################################
  32. ;###    Configuration defaults
  33. ;###################################################################################################
  34. (set #prgname        "elCID")        ;### Simply the program name.
  35. (set #dirname        "elCID")        ;### Directory name to be created at first install.
  36. (set #dest            "elCID:")        ;### Default installation path. Primary needed for update check.
  37. (set #backupext        "_Backup")        ;### Directory backup extension.
  38. (set #checkfile        "elCIDWatch")    ;### File to check version of old and new installation.
  39. (set #minosver        37)                ;### Minimum OS version
  40. (set #mincpu        0)                ;### Minimum CPU.
  41. (set #minmuiver        14)                ;### Minimum MUI version
  42. (set #setassign        1)                ;### Set elCID: assign
  43.  
  44. ;###################################################################################################
  45. ;###    Strings
  46. ;###################################################################################################
  47.  
  48. ;### German strings
  49. (if (= @language "deutsch")
  50. (
  51.     (set #wronginstaller    (cat    "Achtung! Es ist eine alte Version des Programmes 'Installer' auf "
  52.                                     "Ihrem Amiga!\n\nDie Installation benötigt mindestens Installer "
  53.                                     "42.9.\n\nBitte überprüfen Sie Ihre Konfiguration!"))
  54.  
  55.     (set #msgwelcome1        (cat    "\nWillkommen zur \n\n" #prgname))
  56.     (set #msgwelcome2                " Installation.\n\n")
  57.  
  58.     (set #msgcopyright        (cat    "Copyright ©1997-1998 by\n"
  59.                                     "Carsten 'michelangelo' Scholling\n\n"
  60.                                     "<cscholling@t-online.de>\n"
  61.                                     "elcid@galaxy5.com\n"
  62.                                     "http://home.t-online.de/home/cscholling/\n"))
  63.  
  64.     (set #msgprerelease        (cat    "\nDies ist ein PreRelease. Einige Teile sind noch nicht\n"
  65.                                     "fertiggestellt. Der Installer fragt nach dem Ziel für\n"
  66.                                     "die Dokumentation (Docs). Diese sind nicht enthalten!!\n"
  67.                                     "Nur die Guide files sind enthalten.\n"
  68.                                     "Ignorieren Sie diese Frage!\n"))
  69.  
  70.     (set #msgstartup1        (cat    "\n" #prgname " ist eine multifunktionelle Software\n"
  71.                                     "die augenblicklich noch nicht völlig fertiggestellt\n"
  72.                                     "ist. Sie installieren dieses PreRelease auf eigene Gefahr.\n"
  73.                                     "Bitte beachten Sie, daß während der Installation nichts\n"
  74.                                     "zerstört oder gelöscht wird, ohne daß Sie danach gefragt\n"
  75.                                     "werden. Alle Dateien werden ins gleiche Zielverzeichnis\n"
  76.                                     "kopiert, es sei denn, Sie ändern diese Voreinstellungen.\n"
  77.                                     "Seien Sie trotzdem vorsichtig!\n"))
  78.  
  79.     (set #msgstartup2        (cat    "\nBevor Sie die Installation fortsetzen, beenden Sie bitte\n"
  80.                                     "alle ISDN- und andere Online-Verbindungen, beenden Sie Ihre\n"
  81.                                     "Kommunikationssoftware und fahren Sie dann fort.\n"))
  82.  
  83.     (set #msgstartup3        (cat    "\nBitte beachten Sie: Diese Software arbeitet optimal mit den\n"
  84.                                     "VMC Treibern (vmcisdnX.device, ...) zusammen. Bitte lesen Sie\n"
  85.                                     "in der Dokumentation unbedingt den Abschnitt `About VMC'\n"
  86.                                     "bevor Sie Fragen dazu an mich stellen.\n"))
  87.  
  88.     (set #msgnomui            (cat    "\n" #prgname " benötigt zum Arbeiten das \"Magic User Interface\""
  89.                                     "(MUI) in der Version 3.3 oder höher. Das Copyright für MUI liegt\n"
  90.                                     "bei Stefan Stuntz.\n\n"
  91.                                     "Ich habe kein installiertes MUI System auf Ihrem Rechner gefunden\n"
  92.                                     "Bitte installieren Sie MUI bevor Sie " #prgname " starten.\n"
  93.                                     "Am besten installieren Sie MUI direkt im Anschluß an " #prgname ".\n"
  94.                                     "Sie finden MUI im Verzeichnis Aminet/util/libs/muiXXusr.lha."))
  95.  
  96.     (set #msgmuiversion        (cat    "\nSie haben eine veraltete MUI Version auf ihrem System\n"
  97.                                     "installiert. " #prgname " benötigt zur einwandfreien Funktion\n"
  98.                                     "mindestens Version 3.3. Bitte installieren Sie das MUI Update\n"
  99.                                     "BEVOR Sie " #prgname " starten.\n\n"
  100.                                     "Die derzeit bei Ihnen installierte Version ist "))
  101.  
  102.     (set #msgoldinst        (cat    "Ich habe eine alte " #prgname " Version auf Ihrem System gefunden.\n"
  103.                                     "Bitte wählen Sie, wie die Installation fortgesetzt werden soll.\n"))
  104.  
  105.     (set #msgoldinstupdate            "Update der alten Version")
  106.     (set #msgoldinstnew                "Neuinstallation")
  107.  
  108.     (set #msgwhichdest        (cat    "Wo soll " #prgname " installiert werden?\nEin Verzeichnis mit dem "
  109.                                     "Namen " #dirname " wird dort erstellt."))
  110.  
  111.     (set #msgdirexists1                "Ich habe warscheinlich eine alte Installation in\n\"")
  112.     (set #msgdirexists2                "\"\ngefunden. Wie soll ich fortfahren?")
  113.  
  114.     (set #msgdirexistsselect        "Neues Ziel wählen")
  115.     (set #msgdirexistsoverwrite        "Alte Installation überschreiben")
  116.     (set #msgdirexistsdelete        "Alte Installation löschen")
  117.     (set #msgdirexistsbackup        "Sicherheitskopie anlegen: ")
  118.  
  119.     (set #msgdelete                    "Folgende(s) Datei/Verzeichnis wird nun gelöscht:\n")
  120.  
  121.     (set #msgrename1                "Benenne\n")
  122.     (set #msgrename2                " um in ")
  123.  
  124.     (set #msgmakedir                "Folgendes Verzeichnis wird nun erstellt:\n")
  125.  
  126.     (set #msgwherelib                "Wo sollen die Bibliotheken installiert werden?")
  127.     (set #msgwherelibprog            "PROGDIR:Libs")
  128.     (set #msgwhereliblibs            "Libs:")
  129.  
  130.     (set #msgwherecat                "Wo sollen die Katalogdateien installiert werden?")
  131.     (set #msgwherecatprog            "PROGDIR:catalogs")
  132.     (set #msgwherecatlocale            "Locale:catalogs")
  133.  
  134.     (set #msgwheredoc                "An welche Stelle soll die Dokumentation kopiert werden?")
  135.     (set #msgwheredocprog            "PROGDIR:Docs")
  136.     (set #msgwheredochelp            "Locale:Docs")
  137.  
  138.     (set #msgwherehelp                "An welche Stelle soll die Online-Hilfe kopiert werden?")
  139.     (set #msgwherehelpprog            "PROGDIR:Help")
  140.     (set #msgwherehelphelp            "Locale:Help")
  141.  
  142.     (set #msgconfirm        (cat    "Die folgenden Daten werden zur Installation herangezogen:\n"))
  143.     (set #msgconfirmcpu                "\nProzessor: ")
  144.     (set #msgconfirmfpu                "\nFPU: ")
  145.     (set #msgconfirmos                "\nBetriebssystem: ")
  146.     (set #msgconfirmmui                "\nMUI Version: ")
  147.     (set #msgconfirmdest            "\nInstallationsverzeichnis: ")
  148.     (set #msgconfirmlibdest            "\nLibrary Zielverzeichnis: ")
  149.     (set #msgconfirmcatdest            "\nCatalogs Zielverzeichnis: ")
  150.     (set #msgconfirmdocdest            "\nDokumentationsverzeichnis: ")
  151.     (set #msgconfirmhelpdest        "\nOnline-Hilfe Verzeichnis: ")
  152.     (set #msgconfirmback            "\nSicherungsverzeichnis: ")
  153.     (set #msgconfirmask                "\n\nSoll ich mit diesen Einstellungen fortfahren?\n")
  154.  
  155.     (set #msgprepareinstall            "\nDie Installation wird nun vorbereitet.\nBitte wählen Sie \"Ja\" zum fortfahren.")
  156.  
  157.     (set #msgcollectfiles1            "\nErstelle Dateiliste..")
  158.     (set #msgcollectfiles2            "\nErstelle Dateiliste....")
  159.     (set #msgcollectfiles3            "\nErstelle Dateiliste......")
  160.     (set #msgcollectfiles4            "\nErstelle Dateiliste........")
  161.     (set #msgcollectfiles5            "\nErstelle Dateiliste..........")
  162.  
  163.     (set #msgaskcopyfile            "\nBitte wählen Sie die zu kopierenden Dateien.")
  164.     (set #msgaskcopylib                "\nBitte wählen Sie die zu kopierenden Bibliotheken.")
  165.     (set #msgaskcopycat                "\nBitte wählen Sie die zu kopierenden Katalogdateien.")
  166.     (set #msgaskcopydoc                "\nBitte wählen Sie die zu kopierende Dokumentation.")
  167.     (set #msgaskcopyhelp            "\nBitte wählen Sie die zu kopierende Online-Hilfe.")
  168.  
  169.     (set #msgmodifystartup1            "\nIch werde nun die Zeile\n")
  170.     (set #msgmodifystartup2            "\nin die Datei \"User-Startup\" einfügen.\n")
  171.  
  172.     (set #msgend            (cat    "\n" #prgname " Installation beendet!\n\n"))
  173. )
  174.  
  175. ;### English strings
  176. (
  177.     (set #wronginstaller    (cat    "You have an old version of the program 'Installer' on your Amiga!\n\n"
  178.                                     "The installation procedure needs at least Installer 42.9.\n\n"
  179.                                     "Please check your configuration and update1!\n"))
  180.  
  181.     (set #msgwelcome1        (cat    "\nWelcome to\n\n" #prgname))
  182.     (set #msgwelcome2                " installation.\n\n")
  183.  
  184.     (set #msgcopyright        (cat    "Copyright ©1997-1998 by\n"
  185.                                     "Carsten 'michelangelo' Scholling\n\n"
  186.                                     "<cscholling@t-online.de>\n"
  187.                                     "elcid@galaxy5.com\n"
  188.                                     "http://home.t-online.de/home/cscholling/\n"))
  189.  
  190.     (set #msgprerelease        (cat    "\nThis is a PreRelease. Some parts are not finished yet.\n"
  191.                                     "The Installer asks you for a destination for the\n"
  192.                                     "dokumentation (Docs). These files are not included!!\n"
  193.                                     "Only the guide files are included!!\n"
  194.                                     "Ignoriere this question!\n"))
  195.  
  196.     (set #msgstartup1        (cat    "\n" #prgname " is a multifunctional piece of software\n"
  197.                                     "and not completely finished yet. You install this\n"
  198.                                     "prerelease at your own risk. Please notice, that\n"
  199.                                     "nothing will be destroyed during installation\n"
  200.                                     "without asking and all files are stored in the same\n"
  201.                                     "place exept you change these defaults.\n"
  202.                                     "However, you have to take care.\n"))
  203.  
  204.     (set #msgstartup2        (cat    "\nBefore you go on, please stop all\n"
  205.                                     "ISDN- and other connections, quit all\n"
  206.                                     "communication software, then continue.\n"))
  207.  
  208.     (set #msgstartup3        (cat    "\nNotice: This software works fine with VMC software\n"
  209.                                     "(vmcisdnX.device and so on). Please read the included\n"
  210.                                     "information `About VMC' before bothering me with questions\n"
  211.                                     "why not direct supporting other ISDN device driver...\n"))
  212.  
  213.     (set #msgnomui            (cat    "\n" #prgname " needs Magic User Interface (MUI)\nversion 3.3 or "
  214.                                     "higher.\nMUI is copyright by Stefan Stuntz.\n\n"
  215.                                     "I have not found MUI in your system.\nPlease install it before "
  216.                                     "running " #prgname ".\nBest is, right after this installation.\n\n"
  217.                                     "You can find MUI on Aminet/util/libs/muiXXusr.lha."))
  218.  
  219.     (set #msgmuiversion        (cat    "\nYou have installed an outdated version of MUI.\n\n" #prgname " needs "
  220.                                     "at least version 3.3 or higher.\nPlease make sure to install the "
  221.                                     "right version\nbefore starting " #prgname ".\n\nYour currently installed "
  222.                                     "version is "))
  223.  
  224.     (set #msgoldinst        (cat    "I have found an old installation of " #prgname
  225.                                     "\nPlease tell me how to go on."))
  226.  
  227.     (set #msgoldinstupdate            "Update old installation")
  228.     (set #msgoldinstnew                "Install new")
  229.  
  230.     (set #msgwhichdest        (cat    "Where do you wish to install " #prgname "?\nA directory called `"
  231.                                     #dirname"' will be created there."))
  232.  
  233.     (set #msgdirexists1                "I have probably found an old installation in\n\"")
  234.     (set #msgdirexists2                "\"\nWhat should i do?")
  235.  
  236.     (set #msgdirexistsselect        "Select new destination")
  237.     (set #msgdirexistsoverwrite        "Overwrite old files in this directory")
  238.     (set #msgdirexistsdelete        "Delete directory contents (including subdirectories)")
  239.     (set #msgdirexistsbackup        "Backup this directory to ")
  240.  
  241.     (set #msgdelete                    "The following file/directory will be deleted:\n")
  242.  
  243.     (set #msgrename1                "Is it OK to rename\n")
  244.     (set #msgrename2                " to ")
  245.  
  246.     (set #msgmakedir                "The following directory will be created:\n")
  247.  
  248.     (set #msgwherelib                "Where do you want the support library to be installed?")
  249.     (set #msgwherelibprog            "PROGDIR:Libs")
  250.     (set #msgwhereliblibs            "Libs:")
  251.  
  252.     (set #msgwherecat                "Where do you want the catalog files to be installed?")
  253.     (set #msgwherecatprog            "PROGDIR:catalogs")
  254.     (set #msgwherecatlocale            "Locale:catalogs")
  255.  
  256.     (set #msgwheredoc                "Where do you want the documentation to be installed?")
  257.     (set #msgwheredocprog            "PROGDIR:Docs")
  258.     (set #msgwheredochelp            "Locale:Docs")
  259.  
  260.     (set #msgwherehelp                "Where do you want the online help to be installed?")
  261.     (set #msgwherehelpprog            "PROGDIR:Help")
  262.     (set #msgwherehelphelp            "Locale:Help")
  263.  
  264.     (set #msgconfirm        (cat    "The following data will be used to install " #prgname ":\n"))
  265.     (set #msgconfirmcpu                "\nCentral Processing Unit: ")
  266.     (set #msgconfirmfpu                "\nFloating Point Unit: ")
  267.     (set #msgconfirmos                "\nOperating System: ")
  268.     (set #msgconfirmmui                "\nMUI version: ")
  269.     (set #msgconfirmdest            "\nInstallation directory: ")
  270.     (set #msgconfirmlibdest            "\nLibrary directory: ")
  271.     (set #msgconfirmcatdest            "\nCatalog files directory: ")
  272.     (set #msgconfirmdocdest            "\nDocumentation directory: ")
  273.     (set #msgconfirmhelpdest        "\nOnline-Help directory: ")
  274.     (set #msgconfirmback            "\nBackup directory: ")
  275.     (set #msgconfirmask                "\n\nIs it O.K. to use this information to go on?\n")
  276.  
  277.     (set #msgprepareinstall            "\nNow preparing and setting up installation.\nThis may take a moment.")
  278.  
  279.     (set #msgcollectfiles1            "\nCollecting installation filelist..")
  280.     (set #msgcollectfiles2            "\nCollecting installation filelist....")
  281.     (set #msgcollectfiles3            "\nCollecting installation filelist......")
  282.     (set #msgcollectfiles4            "\nCollecting installation filelist........")
  283.     (set #msgcollectfiles5            "\nCollecting installation filelist..........")
  284.  
  285.     (set #msgaskcopyfile            "\nPlease select which files you want to copy.")
  286.     (set #msgaskcopylib                "\nPlease select which libraries you want to copy.")
  287.     (set #msgaskcopycat                "\nPlease select which catalog files you want to copy.")
  288.     (set #msgaskcopydoc                "\nPlease select which documentation you want to copy.")
  289.     (set #msgaskcopyhelp            "\nPlease select which online-help you want to copy.")
  290.  
  291.     (set #msgmodifystartup1    (cat    "\nNow, the file \"User-Startup\" will be updated with the "
  292.                                     "following line:\n"))
  293.     (set #msgmodifystartup2            "\n")
  294.  
  295.     (set #msgend            (cat    "\n" #prgname " installation complete!\n\n"))
  296. ))
  297.  
  298.  
  299.  
  300. ;###################################################################################################
  301. ;###################################################################################################
  302. ;###
  303. ;###    Standard functions
  304. ;###
  305. ;###################################################################################################
  306. ;###################################################################################################
  307.  
  308. ;###################################################################################################
  309. ;###    Procedure CheckOS
  310. ;###################################################################################################
  311. (procedure P_CheckOS
  312.     (set os    (/ (getversion "libs:version.library") 65536))
  313.  
  314.     (if (= os 37)    (set osname "2.0"))
  315.     (if (= os 38)    (set osname "2.1"))
  316.     (if (= os 39)    (set osname "3.0"))
  317.     (if (= os 40)    (set osname "3.1"))
  318.     (if (= os 41)    (set osname "3.5"))
  319.     (if (> os 41)    (set osname "3.5+ (not known)"))
  320.  
  321.     (if (>= os minosver)
  322.         (set ret 1)
  323.         (set ret 0)
  324.     )
  325. )
  326.  
  327.  
  328. ;###################################################################################################
  329. ;###    Procedure CheckCPU
  330. ;###################################################################################################
  331. (procedure P_CheckCPU
  332.     (set cpuname    (database "cpu"))
  333.     (set fpuname    (database "fpu"))
  334.  
  335.     (if (= cpuname "68000")    (set cpu 0))
  336.     (if (= cpuname "68010")    (set cpu 1))
  337.     (if (= cpuname "68020")    (set cpu 2))
  338.     (if (= cpuname "68030")    (set cpu 3))
  339.     (if (= cpuname "68040")    (set cpu 4))
  340.     (if (> (exists ("sys:libs/68060.library")) 0) (
  341.         (set cpuname "68060")
  342.         (set cpu 6)
  343.     ))
  344.  
  345.     (if (= fpuname "NOFPU")    (set fpu 0))
  346.     (if (= fpuname "68881")    (set fpu 1))
  347.     (if (= fpuname "68882")    (set fpu 2))
  348.     (if (= fpuname "FPU40")    (set fpu 4))
  349.     (if (> (exists ("sys:libs/68060.library")) 0) (
  350.         (set fpuname "FPU60")
  351.     ))
  352.  
  353.     (if (>= cpu mincpu)
  354.         (set ret 1)
  355.         (set ret 0)
  356.     )
  357. )
  358.  
  359.  
  360. ;###################################################################################################
  361. ;###    Procedure GetVersion
  362. ;###################################################################################################
  363. (procedure P_GetVersion p_file
  364.     (set ver            (/ (getversion p_file) 65536))
  365. )
  366.  
  367.  
  368. ;###################################################################################################
  369. ;###    Procedure GetRevision
  370. ;###################################################################################################
  371. (procedure P_GetRevision p_file
  372.     (set vers            (getversion p_file))
  373.     (set ver            (/ vers 65536))
  374.  
  375.     (set rev            (- vers (* ver 65536)))
  376. )
  377.  
  378.  
  379. ;###################################################################################################
  380. ;###    Procedure GetFullVersion
  381. ;###################################################################################################
  382. (procedure P_GetFullVersion p_file
  383.     (set vers            (getversion p_file))
  384.     (set ver            (/ vers 65536))
  385.     (set rev            (- vers (* ver 65536)))
  386.     (set version        (cat ver "." rev))
  387.  
  388.     (set version version)
  389. )
  390.  
  391.  
  392. ;###################################################################################################
  393. ;###    Procedure CatPath
  394. ;###################################################################################################
  395. (procedure P_CatPath p_p1 p_p2
  396.  
  397.     (set len (- (strlen p_p1) 1))
  398.  
  399.     (if (> len 0)
  400.         (if (= (substr p_p1 len 1) ":")
  401.             (set p (cat p_p1 p_p2))
  402.             (set p (cat p_p1 "/" p_p2))
  403.         )
  404.         (set p p_p2)
  405.     )
  406. )
  407.  
  408.  
  409. ;###################################################################################################
  410. ;###    Procedure StripFile
  411. ;###################################################################################################
  412. (procedure P_StripFile p_p
  413.  
  414.     (set len (- (strlen p_p) 1))
  415.  
  416.     (while (> len 0) (
  417.         (if (= (substr p_p len 1) "/")
  418.             (
  419.                 (set newlen len)
  420.                 (set len 0)
  421.             )
  422.             (
  423.                 (if (= (substr p_p len 1) ":")
  424.                     (
  425.                         (set newlen len)
  426.                         (set len 0)
  427.                     )
  428.                 )
  429.             )
  430.         )
  431.         (set len (- len 1))
  432.     ))
  433.  
  434.     (set newlen (+ newlen 1))
  435.     (set retp (substr p_p 0 newlen))
  436. )
  437.  
  438.  
  439. ;###################################################################################################
  440. ;###    Procedure CheckExists
  441. ;###################################################################################################
  442. (procedure P_CheckExists p_file
  443.     (set ret (exists p_file (noreq)))
  444. )
  445.  
  446.  
  447. ;###################################################################################################
  448. ;###    Procedure Rename
  449. ;###################################################################################################
  450. (procedure P_Rename p_file p_new
  451.     (if (= 2 @user-level)
  452.         (rename p_file p_new
  453.             (confirm)
  454.             (prompt (cat #msgrename1 p_file #msgrename2 p_new))
  455.             (help (cat #msgrename1 p_file #msgrename2 p_new))
  456.         )
  457.  
  458.         (rename p_file p_new)
  459.     )
  460. )
  461.  
  462.  
  463. ;###################################################################################################
  464. ;###    Procedure MakeDir
  465. ;###################################################################################################
  466. (procedure P_MakeDir p_dir p_confirm p_icon
  467.     (if (> p_confirm 0)
  468.         (if (> p_icon 0)
  469.             (makedir p_dir
  470.                 (confirm)
  471.                 (prompt (cat #msgmakedir p_dir))
  472.                 (help (cat #msgmakedir p_dir))
  473.                 (infos)
  474.             )
  475.             (makedir p_dir
  476.                 (confirm)
  477.                 (prompt (cat #msgmakedir p_dir))
  478.                 (help (cat #msgmakedir p_dir))
  479.             )
  480.         )
  481.  
  482.         (if (> p_icon 0)
  483.             (makedir p_dir (infos))
  484.             (makedir p_dir)
  485.         )
  486.     )
  487. )
  488.  
  489.  
  490. ;###################################################################################################
  491. ;###    Procedure Rename
  492. ;###################################################################################################
  493. (procedure P_Delete p_file P_confirm
  494.     (if (> p_confirm 0)
  495.         (delete p_file
  496.             (confirm) (all)
  497.             (prompt (cat #msgdelete p_file))
  498.             (help (cat #msgdelete p_file))
  499.             (optional "force" "askuser")
  500.         )
  501.         (delete p_file
  502.             (all)
  503.             (optional "force")
  504.         )
  505.     )
  506. )
  507.  
  508.  
  509. ;###################################################################################################
  510. ;###    Procedure SelectDir
  511. ;###################################################################################################
  512. (procedure P_SelectDir p_text p_help p_dest
  513.  
  514.     ;### Ask the user for any directory.
  515.     (set p_dest
  516.         (askdir
  517.             (prompt        p_text)
  518.             (help        (cat p_help "\n\n" @askdir-help))
  519.             (default    p_dest)
  520.         )
  521.     )
  522.  
  523.     (set p_dest p_dest)
  524. )
  525.  
  526.  
  527. ;###################################################################################################
  528. ;###    Procedure PreInstall
  529. ;###################################################################################################
  530. (procedure P_PreInstall
  531.     (set libdest "")
  532.     (set catdest "")
  533.     (set docdest "")
  534.     (set helpdest "")
  535.     (set filecount 1)
  536. )
  537.  
  538.  
  539. ;###################################################################################################
  540. ;###    Procedure CheckOldInst
  541. ;###################################################################################################
  542. (procedure P_CheckOldInst
  543.     ;### Old installation?
  544.     (if (P_CheckExists #dest)
  545.     (
  546.         ;### Let the user select what to do (update, install new).
  547.         (set    choice
  548.             (askchoice
  549.                 (prompt        #msgoldinst)
  550.                 (help        (cat #msgoldinst "\n\n" askchoice-help))
  551.                 (choices    #msgoldinstupdate #msgoldinstnew)
  552.                 (default    0)
  553.             )
  554.         )
  555.  
  556.         (if (= 0 choice)
  557.         (
  558.             (set @default-dest #dest)
  559.             (set libdest  (P_CatPath #dest "Libs"))
  560.             (set catdest  (P_CatPath #dest "catalogs"))
  561.             (set docdest  (P_CatPath #dest "Docs"))
  562.             (set helpdest (P_CatPath #dest "Help"))
  563.             (set update 1)
  564.         ))
  565.         (if (= 1 choice) (
  566.             (set #dest (P_CatPath @default-dest #dirname))
  567.             (set libdest  (P_CatPath #dest "Libs"))
  568.             (set catdest  (P_CatPath #dest "catalogs"))
  569.             (set docdest  (P_CatPath #dest "Docs"))
  570.             (set helpdest (P_CatPath #dest "Help"))
  571.             (set update 0)
  572.         ))
  573.     )
  574.     (
  575.         (set #dest @default-dest)
  576.         (set libdest  (P_CatPath #dest "Libs"))
  577.         (set catdest  (P_CatPath #dest "catalogs"))
  578.         (set docdest  (P_CatPath #dest "Docs"))
  579.         (set helpdest (P_CatPath #dest "Help"))
  580.         (set update 0)
  581.     ))
  582. )
  583.  
  584.  
  585. ;###################################################################################################
  586. ;###    Procedure Welcome
  587. ;###################################################################################################
  588. (procedure P_About p_update
  589.     (message (cat #msgwelcome1 " " (P_GetFullVersion #checkfile) #msgwelcome2 #msgcopyright))
  590.  
  591.     (if (= 0 update) (
  592.         (message #msgprerelease)
  593.         (message #msgstartup1)
  594.         (message #msgstartup2)
  595.         (message #msgstartup3)
  596.     ))
  597. )
  598.  
  599.  
  600. ;###################################################################################################
  601. ;###    Procedure CheckMUI
  602. ;###################################################################################################
  603. (procedure P_CheckMUI p_minver
  604.     (set muifound 0)
  605.  
  606.     (if (P_CheckExists "mui:")
  607.         (set muifound 1)
  608.         (if (P_CheckExists "libs:muimaster.library")
  609.             (set muifound 2)
  610.         )
  611.     )
  612.  
  613.     (if (= 0 muifound)
  614.         (message #msgnomui)
  615.         (
  616.             (if    (= 1 muifound)    (set ver (P_GetVersion "mui:mui")))
  617.             (if    (= 2 muifound)    (set ver (P_GetVersion "libs:muimaster.library")))
  618.  
  619.             (if (= ver 7)    (set muiver "2.0"))
  620.             (if (= ver 8)    (set muiver "2.1"))
  621.             (if (= ver 9)    (set muiver "2.2"))
  622.             (if (= ver 10)    (set muiver "2.3"))
  623.             (if (= ver 11)    (set muiver "3.0"))
  624.             (if (= ver 12)    (set muiver "3.1"))
  625.             (if (= ver 13)    (set muiver "3.2"))
  626.             (if (= ver 14)    (set muiver "3.3"))
  627.             (if (= ver 15)    (set muiver "3.4"))
  628.             (if (= ver 16)    (set muiver "3.5"))
  629.             (if (= ver 17)    (set muiver "3.6"))
  630.             (if (= ver 18)    (set muiver "3.7"))
  631.             (if (= ver 19)    (set muiver "3.8"))
  632.             (if (> ver 19)    (set muiver "3.9+ (not known)"))
  633.  
  634.             (if (<= ver p_minver)
  635.                 (message (cat #msgmuiversion muiver))
  636.             )
  637.         )
  638.     )
  639.  
  640.     (set ver ver)
  641. )
  642.  
  643.  
  644. ;###################################################################################################
  645. ;###    Procedure CheckInstPath
  646. ;###################################################################################################
  647. (procedure P_CheckInstPath p_path p_newdirname
  648.     (set choice 4)
  649.     (set path (P_CatPath p_path p_newdirname))
  650.     (set backdir "")
  651.     (set mdeb (cat #msgdirexistsbackup (cat p_newdirname #backupext)))
  652.  
  653.     (if (= 0 update) (
  654.  
  655.         ;### New directory allready there?
  656.         (if (= 2 (P_CheckExists path))
  657.         (
  658.             ;### Let the user select what to do with this dir.
  659.             (set    choice
  660.                 (askchoice
  661.                     (prompt        (cat #msgdirexists1 (expandpath path) #msgdirexists2))
  662.                     (help        (cat #msgdirexists1 (expandpath path) #msgdirexists2 "\n\n" askchoice-help))
  663.                     (choices    #msgdirexistsselect #msgdirexistsoverwrite #msgdirexistsdelete mdeb)
  664.                     (default    1)
  665.                 )
  666.             )
  667.  
  668.             (set #dest path)
  669.             (set libdest  (P_CatPath path "Libs"))
  670.             (set catdest  (P_CatPath path "catalogs"))
  671.             (set docdest  (P_CatPath path "Docs"))
  672.             (set helpdest (P_CatPath path "Help"))
  673.             (set backdir "")
  674.  
  675.             (if (= 1 choice) (
  676.                 (set whatwithold 1)
  677.             ))
  678.  
  679.             (if (= 2 choice) (
  680.                 (set whatwithold 2)
  681.             ))
  682.  
  683.             (if (= 3 choice) (
  684.                 (set backdir (cat path #backupext))
  685.                 (set whatwithold 3)
  686.             ))
  687.         ))
  688.  
  689.         (if (= 0 choice)
  690.             (set ret 0)
  691.             (set #dest path)
  692.         )
  693.     ))
  694. )
  695.  
  696.  
  697. ;###################################################################################################
  698. ;###    Procedure SetupInstall
  699. ;###################################################################################################
  700. (procedure P_SetupInstall
  701.  
  702.     (if (= 0 update)
  703.     (
  704.         ;### Select installation path
  705.         (while (= 0 (P_CheckInstPath    (P_SelectDir #msgwhichdest #msgwhichdest #dest) #dirname)))
  706.  
  707.         ;### Let the user select where to put the libraries.
  708.         (set    choice
  709.             (askchoice
  710.                 (prompt        #msgwherelib)
  711.                 (help        (cat #msgwherelib "\n\n" askchoice-help))
  712.                 (choices    #msgwherelibprog #msgwhereliblibs)
  713.                 (default    0)
  714.             )
  715.         )
  716.  
  717.         (if (= 0 choice) (set libdest (P_CatPath #dest "Libs")))
  718.         (if (= 1 choice) (set libdest "Libs:"))
  719.  
  720.         ;### Let the user select where to put the catalogs.
  721.         (set    choice
  722.             (askchoice
  723.                 (prompt        #msgwherecat)
  724.                 (help        (cat #msgwherecat "\n\n" askchoice-help))
  725.                 (choices    #msgwherecatprog #msgwherecatlocale)
  726.                 (default    0)
  727.             )
  728.         )
  729.  
  730.         (if (= 0 choice) (set catdest (P_CatPath #dest "catalogs")))
  731.         (if (= 1 choice) (set catdest "Locale:catalogs"))
  732.  
  733.         ;### Let the user select where to put the docs.
  734.         (set    choice
  735.             (askchoice
  736.                 (prompt        #msgwheredoc)
  737.                 (help        (cat #msgwheredoc "\n\n" askchoice-help))
  738.                 (choices    #msgwheredocprog #msgwheredochelp)
  739.                 (default    0)
  740.             )
  741.         )
  742.  
  743.         (if (= 0 choice) (set docdest (P_CatPath #dest "Docs")))
  744.         (if (= 1 choice) (set docdest "Locale:Docs"))
  745.  
  746.         ;### Let the user select where to put the online help.
  747.         (set    choice
  748.             (askchoice
  749.                 (prompt        #msgwherehelp)
  750.                 (help        (cat #msgwherehelp "\n\n" askchoice-help))
  751.                 (choices    #msgwherehelpprog #msgwherehelphelp)
  752.                 (default    0)
  753.             )
  754.         )
  755.  
  756.         (if (= 0 choice) (set helpdest (P_CatPath #dest "Help")))
  757.         (if (= 1 choice) (set helpdest "Locale:Help"))
  758.  
  759.     )
  760.  
  761.     ;### Only update old installation
  762.     (
  763.         (P_CheckInstPath #dest "")
  764.         (if (P_CheckExists libdest)
  765.             (if (P_CheckExists (P_CatPath libdest "elcid.library"))
  766.                 (set libdest libdest)
  767.                 (
  768.                     (if (P_CheckExists "libs:elcid.library")
  769.                         (set libdest "Libs:")
  770.                     )
  771.                 )
  772.             )
  773.         )
  774.  
  775.         (if (P_CheckExists catdest)
  776.             (if (P_CheckExists (P_CatPath #dest "catalogs"))
  777.                 (set catdest (P_CatPath #dest "catalogs"))
  778.                 (set catdest "Locale:catalogs")
  779.             )
  780.         )
  781.  
  782.         (if (P_CheckExists docdest)
  783.             (if (P_CheckExists (P_CatPath #dest "Docs"))
  784.                 (set docdest (P_CatPath #dest "Docs"))
  785.                 (set docdest "Locale:Docs")
  786.             )
  787.         )
  788.  
  789.         (if (P_CheckExists helpdest)
  790.             (if (P_CheckExists (P_CatPath #dest "Help"))
  791.                 (set helpdest (P_CatPath #dest "Help"))
  792.                 (set helpdest "Locale:Help")
  793.             )
  794.         )
  795.     ))
  796. )
  797.  
  798. ;###################################################################################################
  799. ;###    Procedure AskConfirmation
  800. ;###################################################################################################
  801. (procedure P_AskConfirmation
  802.  
  803.     (set msgconfirm1        (cat    #msgconfirm
  804.                                     #msgconfirmcpu    cpuname
  805.                                     #msgconfirmfpu    fpuname
  806.                                     #msgconfirmos    osname))
  807.  
  808.     (if (muiver)
  809.         (set msgconfirm2    (cat    #msgconfirmmui muiver))
  810.     )
  811.  
  812.     (set msgconfirm3        (cat    #msgconfirmdest        #dest
  813.                                     #msgconfirmlibdest    libdest
  814.                                     #msgconfirmcatdest    catdest
  815.                                     #msgconfirmdocdest    docdest
  816.                                     #msgconfirmhelpdest    helpdest))
  817.  
  818.     (if (backdir)
  819.         (set msgconfirm4    (cat    #msgconfirmback (expandpath backdir)))
  820.     )
  821.  
  822.     (set msgconfirm            (cat    msgconfirm1 msgconfirm2 msgconfirm3 msgconfirm4 #msgconfirmask))
  823.  
  824.     ;### All right?
  825.     (set    choice
  826.         (askbool
  827.             (prompt        msgconfirm)
  828.             (help        msgconfirm)
  829.             (default    1)
  830.         )
  831.     )
  832.  
  833.     (set choice choice)
  834. )
  835.  
  836.  
  837. ;###################################################################################################
  838. ;###    Procedure PrepareInstall
  839. ;###################################################################################################
  840. (procedure P_PrepareInstall
  841.  
  842.     (askbool
  843.         (prompt        #msgprepareinstall)
  844.         (help        (cat #msgprepareinstall @askbool-help))
  845.         (default    1)
  846.     )
  847.  
  848.     (if (= 1 whatwithold) (
  849.         (set dummy "dummy")
  850.     ))
  851.  
  852.     (if (= 2 whatwithold) (
  853.         (P_Delete (P_CatPath #dest "#?") 1)
  854.     ))
  855.  
  856.     (if (= 3 whatwithold) (
  857.         (P_Rename    #dest backdir)
  858.         (P_MakeDir    #dest 1 1)
  859.     ))
  860. )
  861.  
  862.  
  863. ;###################################################################################################
  864. ;###    Procedure CreateFileList
  865. ;###################################################################################################
  866. (procedure P_CreateFileList p_path p_pat p_dir
  867.  
  868.     (if (= 2 (P_CheckExists p_path)) (
  869.  
  870.         (set path (P_CatPath p_path p_pat))
  871.  
  872.         (if (= 0 (P_CheckExists "ENV:eçtem¶tic1")) (
  873.             (run "setenv eçtem¶tic1 0")
  874.         ))
  875.  
  876.         (set oldexecutedir @execute-dir)
  877.  
  878.         (run (cat "echo >env:eçtem¶tfe \"setenv eçtem¶tic2 0\""))
  879.  
  880.         (if (= 0 p_dir)
  881.             (
  882.                 (set runstring (cat "list >>env:eçtem¶tfe " path " lformat \"echo >env:eçtem¶tf*$eçtem¶tic1.*$eçtem¶tic2 *\"%p%n*\" noline*necho >env:eçtem¶ts*$eçtem¶tic1.*$eçtem¶tic2 *\"%c*\" noline*neval *$eçtem¶tic2 + 1 to env:eçtem¶tic2\" files"))
  883.             )
  884.             (
  885.                 (set @execute-dir (expandpath p_path))
  886.                 (set runstring (cat "list >>env:eçtem¶tfe " p_pat " lformat \"echo >env:eçtem¶tf*$eçtem¶tic1.*$eçtem¶tic2 *\"%p%n*\" noline*necho >env:eçtem¶ts*$eçtem¶tic1.*$eçtem¶tic2 *\"%c*\" noline*necho >env:eçtem¶td*$eçtem¶tic1.*$eçtem¶tic2 *\"" p_path "*\" noline*neval *$eçtem¶tic2 + 1 to env:eçtem¶tic2\" files all"))
  887.             )
  888.         )
  889.  
  890.         (run runstring)
  891.         (run (cat "echo >>env:eçtem¶tfe \"if exists env:eçtem¶tf*$eçtem¶tic1.0*neval *$eçtem¶tic1 + 1 to env:eçtem¶tic1*nendif\""))
  892.  
  893.         (execute "env:eçtem¶tfe")
  894.  
  895.         (set @execute-dir oldexecutedir)
  896.  
  897.         (set filecount (+ filecount (getenv "ENV:eçtem¶tic2")))
  898.     ))
  899. )
  900.  
  901.  
  902. ;###################################################################################################
  903. ;###    Procedure CopyFiles
  904. ;###################################################################################################
  905. (procedure P_CopyFiles p_dir p_file
  906.  
  907.     (set src (P_CatPath p_dir p_file))
  908.  
  909.     (if (patmatch "#?libs#?" p_dir)
  910.         (
  911.             (set dst (P_StripFile (P_CatPath libdest p_file)))
  912.             (if (= 0 (P_CheckExists dst))    (P_MakeDir    dst 1 0))
  913.             (copylib
  914.                 (source src)
  915.                 (dest dst)
  916.             )
  917.         )
  918.  
  919.         (if (patmatch "#?catalogs#?" p_dir)
  920.             (
  921.                 (set dst (P_StripFile (P_CatPath catdest p_file)))
  922.                 (if (= 0 (P_CheckExists dst))    (P_MakeDir    dst 1 1))
  923.                 (copyfiles
  924.                     (source src)
  925.                     (dest dst)
  926.                     (files)
  927.                 )
  928.             )
  929.  
  930.             (if (patmatch "#?docs#?" p_dir)
  931.                 (
  932.                     (set dst (P_StripFile (P_CatPath docdest p_file)))
  933.                     (if (= 0 (P_CheckExists dst))    (P_MakeDir    dst 1 1))
  934.                     (copyfiles
  935.                         (source src)
  936.                         (dest dst)
  937.                         (files)
  938.                     )
  939.                 )
  940.  
  941.                 (if (patmatch "#?help#?" p_dir)
  942.                     (
  943.                         (set dst (P_StripFile (P_CatPath helpdest p_file)))
  944.                         (if (= 0 (P_CheckExists dst))    (P_MakeDir    dst 1 1))
  945.                             (copyfiles
  946.                             (source src)
  947.                             (dest dst)
  948.                             (files)
  949.                         )
  950.                     )
  951.                     (
  952.                         (set dst (P_CatPath #dest p_dir))
  953.                         (if (= 0 (P_CheckExists dst))    (P_MakeDir    dst 1 0))
  954.                         (copyfiles
  955.                             (source src)
  956.                             (dest dst)
  957.                             (files)
  958.                         )
  959.                     )
  960.                 )
  961.             )
  962.         )
  963.     )
  964.  
  965.     (set filecount (+ filecount fc))
  966.     (complete filecount)
  967. )
  968.  
  969.  
  970. ;###################################################################################################
  971. ;###    Ask for copying files
  972. ;###################################################################################################
  973. (procedure p_AskCopyFiles p_d0 p_f0 p_s0 p_d1 p_f1 p_s1 p_d2 p_f2 p_s2 p_d3 p_f3 p_s3 p_d4 p_f4 p_s4 p_d5 p_f5 p_s5 p_d6 p_f6 p_s6 p_d7 p_f7 p_s7 p_defopt
  974.  
  975.     (set ask #msgaskcopyfile)
  976.     (if (patmatch "#?libs#?" p_d0)        (set ask #msgaskcopylib))
  977.     (if (patmatch "#?catalogs#?" p_d0)    (set ask #msgaskcopycat))
  978.     (if (patmatch "#?docs#?" p_d0)        (set ask #msgaskcopydoc))
  979.     (if (patmatch "#?help#?" p_d0)        (set ask #msgaskcopyhelp))
  980.  
  981.     (if (p_f0)    (set a0 (cat (fileonly p_f0) " (" (+ (/ (getsize (P_CatPath p_d0 p_f0)) 1024) 1) "k)  - " p_s0)) (set a0 ""))
  982.     (if (p_f1)    (set a1    (cat (fileonly p_f1) " (" (+ (/ (getsize (P_CatPath p_d1 p_f1)) 1024) 1) "k)  - " p_s1)) (set a1 ""))
  983.     (if (p_f2)    (set a2    (cat (fileonly p_f2) " (" (+ (/ (getsize (P_CatPath p_d2 p_f2)) 1024) 1) "k)  - " p_s2)) (set a2 ""))
  984.     (if (p_f3)    (set a3    (cat (fileonly p_f3) " (" (+ (/ (getsize (P_CatPath p_d3 p_f3)) 1024) 1) "k)  - " p_s3)) (set a3 ""))
  985.     (if (p_f4)    (set a4    (cat (fileonly p_f4) " (" (+ (/ (getsize (P_CatPath p_d4 p_f4)) 1024) 1) "k)  - " p_s4)) (set a4 ""))
  986.     (if (p_f5)    (set a5    (cat (fileonly p_f5) " (" (+ (/ (getsize (P_CatPath p_d5 p_f5)) 1024) 1) "k)  - " p_s5)) (set a5 ""))
  987.     (if (p_f6)    (set a6    (cat (fileonly p_f6) " (" (+ (/ (getsize (P_CatPath p_d6 p_f6)) 1024) 1) "k)  - " p_s6)) (set a6 ""))
  988.     (if (p_f7)    (set a7    (cat (fileonly p_f7) " (" (+ (/ (getsize (P_CatPath p_d7 p_f7)) 1024) 1) "k)  - " p_s7)) (set a7 ""))
  989.  
  990.     ;### All right?
  991.     (set    choice (
  992.         (askoptions (
  993.             (prompt        ask)
  994.             (help        ask @askoptions-help)
  995.             (choices    a0 a1 a2 a3 a4 a5 a6 a7)
  996.             (default    p_defopt)
  997.         ))
  998.     ))
  999.  
  1000.     (if (p_f0) ((if (IN choice 0)    (P_CopyFiles p_d0 p_f0))))
  1001.     (if (p_f1) ((if (IN choice 1)    (P_CopyFiles p_d1 p_f1))))
  1002.     (if (p_f2) ((if (IN choice 2)    (P_CopyFiles p_d2 p_f2))))
  1003.     (if (p_f3) ((if (IN choice 3)    (P_CopyFiles p_d3 p_f3))))
  1004.     (if (p_f4) ((if (IN choice 4)    (P_CopyFiles p_d4 p_f4))))
  1005.     (if (p_f5) ((if (IN choice 5)    (P_CopyFiles p_d5 p_f5))))
  1006.     (if (p_f6) ((if (IN choice 6)    (P_CopyFiles p_d6 p_f6))))
  1007.     (if (p_f7) ((if (IN choice 7)    (P_CopyFiles p_d7 p_f7))))
  1008. )
  1009.  
  1010.  
  1011.  
  1012. ;###################################################################################################
  1013. ;###    Procedure DoInstall
  1014. ;###################################################################################################
  1015. (procedure P_DoInstall
  1016.  
  1017.     (set c1 0 c2 0 check 0)
  1018.     (while (> (P_CheckExists (cat "ENV:eçtem¶tf" c1 ".0")) 0) (
  1019.  
  1020.         (set f0 "" f1 "" f2 "" f3 "" f4 "" f5 "" f6 "" f7 "" defopt 0)
  1021.         (set d0 "" d1 "" d2 "" d3 "" d4 "" d5 "" d6 "" d7 "")
  1022.         (set s0 "" s1 "" s2 "" s3 "" s4 "" s5 "" s6 "" s7 "")
  1023.  
  1024.         (while (> (P_CheckExists (cat "ENV:eçtem¶tf" c1 "." c2)) 0) (
  1025.             (set file (getenv (cat "ENV:eçtem¶tf" c1 "." c2)))
  1026.             (set dir (getenv (cat "ENV:eçtem¶td" c1 "." c2)))
  1027.             (set comment (getenv (cat "ENV:eçtem¶ts" c1 "." c2)))
  1028.  
  1029.             (if (file) (
  1030.                 (symbolset (cat "f" check) file)
  1031.                 (symbolset (cat "d" check) dir)
  1032.                 (symbolset (cat "s" check) comment)
  1033.                 (set defopt (BITOR defopt (shiftleft 1 check)))
  1034.                 (set c2 (+ 1 c2))
  1035.                 (set check (+ 1 check))
  1036.             ))
  1037.  
  1038.             (if (= check 8) (
  1039.                 (set check 0)
  1040.                 (p_AskCopyFiles d0 f0 s0 d1 f1 s1 d2 f2 s2 d3 f3 s3 d4 f4 s4 d5 f5 s5 d6 f6 s6 d7 f7 s7 defopt)
  1041.                 (set f0 "" f1 "" f2 "" f3 "" f4 "" f5 "" f6 "" f7 "" defopt 0)
  1042.                 (set d0 "" d1 "" d2 "" d3 "" d4 "" d5 "" d6 "" d7 "")
  1043.                 (set s0 "" s1 "" s2 "" s3 "" s4 "" s5 "" s6 "" s7 "")
  1044.             ))
  1045.         ))
  1046.  
  1047.         (if (f0)    (p_AskCopyFiles d0 f0 s0 d1 f1 s1 d2 f2 s2 d3 f3 s3 d4 f4 s4 d5 f5 s5 d6 f6 s6 d7 f7 s7 defopt))
  1048.         (set c1 (+ 1 c1) c2 0 check 0)
  1049.     ))
  1050.  
  1051.     (if (= 1 #setassign) (
  1052.         (if (= 0 update) (
  1053.             (startup (@app-name)
  1054.                 (prompt        (cat #msgmodifystartup1 "Assign >nil: " #prgname ": " #dest #msgmodifystartup2))
  1055.                 (help        (cat #msgmodifystartup1 "Assign >nil: " #prgname ": " #dest #msgmodifystartup2 @startup-help))
  1056.                 (confirm)
  1057.                 (command    (cat "Assign >nil: " #prgname ": " (expandpath #dest)))
  1058.             )
  1059.  
  1060.             (makeassign #dirname #dest)
  1061.         ))
  1062.     ))
  1063. )
  1064.  
  1065.  
  1066. ;###################################################################################################
  1067. ;###    Procedure Cleanup
  1068. ;###################################################################################################
  1069. (procedure P_Cleanup
  1070.     (if (> (P_CheckExists #dest) 0) (
  1071.         (run (cat "list >env:eçtem¶te " #dest " pat .info all lformat \"delete %p%n\""))
  1072.         (execute "env:eçtem¶te")
  1073.         (delete "ENV:eçtem¶t#?")
  1074.     ))
  1075. )
  1076.  
  1077.  
  1078. ;###################################################################################################
  1079. ;###    Entry point
  1080. ;###################################################################################################
  1081. ;### We can't handle this script without Installer 42.9 or better!
  1082. (if (< @installer-version 2752521) (
  1083.     (message #wronginstaller)
  1084.     (exit (quiet))
  1085. ))
  1086.  
  1087. (complete 0)
  1088. (P_PreInstall)
  1089.  
  1090. (welcome)
  1091.  
  1092. (P_About (P_CheckOldInst))
  1093.  
  1094. (complete 2)
  1095. (P_CheckOS)
  1096.  
  1097. (complete 4)
  1098. (P_CheckCPU)
  1099.  
  1100. (complete 6)
  1101. (P_CheckMUI #minmuiver)
  1102.  
  1103. (complete 8)
  1104. (P_SetupInstall)
  1105.  
  1106. ;### Ask for confirmation
  1107. (complete 10)
  1108. (if (P_AskConfirmation) (
  1109.     (P_PrepareInstall)
  1110.  
  1111.     ;### Create filelist for all elCID* files and icons
  1112.     (complete 15)
  1113.     (working #msgcollectfiles1)
  1114.     (P_CreateFileList "" "elCID#?" 0)
  1115.  
  1116.     ;### Create filelist for all NOT elCID* files and icons
  1117.     (complete 20)
  1118.     (working #msgcollectfiles2)
  1119.     (P_CreateFileList "" "~(elCID#?|Install_elCID#?)" 0)
  1120.  
  1121.     ;### Create libs directory filelist.
  1122.     (complete 25)
  1123.     (working #msgcollectfiles2)
  1124.     (P_CreateFileList "libs" "#?" 1)
  1125.  
  1126.     ;### Create catalogs directory filelist.
  1127.     (complete 30)
  1128.     (working #msgcollectfiles3)
  1129.     (P_CreateFileList "catalogs" "#?" 1)
  1130.  
  1131.     ;### Create docs directory filelist.
  1132.     (working #msgcollectfiles3)
  1133.     (P_CreateFileList "docs" "#?" 1)
  1134.  
  1135.     ;### Create help directory filelist.
  1136.     (working #msgcollectfiles4)
  1137.     (P_CreateFileList "help" "#?" 1)
  1138.  
  1139.     ;### Create images directory filelist.
  1140.     (working #msgcollectfiles5)
  1141.     (P_CreateFileList "images" "#?" 1)
  1142.  
  1143.     (complete 35)
  1144.     (set fc (/ 60 filecount))
  1145.     (set filecount 35)
  1146.     (P_DoInstall)
  1147. ))
  1148.  
  1149. (complete 100)
  1150. (P_Cleanup)
  1151. (exit #msgend)
  1152.  
  1153.  
  1154.